import 'package:flutter/material.dart';

class CustomAppBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    //适配全面屏 动态获取全面屏
    double paddingTop = MediaQuery.of(context).padding.top;

    return Container(
      //设置外边距
      margin: EdgeInsets.fromLTRB(20, paddingTop + 10, 20, 5),
      //设置内边距
      padding: EdgeInsets.fromLTRB(20, 7, 20, 7),
      decoration: BoxDecoration(
          //实现圆角边框
          borderRadius: BorderRadius.circular(19),
          color: Colors.white60),
      child: Row(
        children: <Widget>[
          Icon(Icons.search, color: Colors.grey),
          //撑开控件的宽度
          Expanded(
              child: Text(
            "微信阅读搜索",
            style: TextStyle(fontSize: 15, color: Colors.grey),
          )),
          //设置 分割线
          Container(
            width: 1,
            height: 20,
            margin: EdgeInsets.only(right: 13),
            decoration: BoxDecoration(color: Colors.grey),
          ),
          Text("书城",style: TextStyle(fontSize: 13),)
        ],
      ),
    );
  }
}













